package com.qipay.scalar.type;


public enum ProductTypeEnum {
    KUAI ((byte) 1, "无卡快捷支付"),
    QQPAY ((byte)2, "QQ支付"),
    UNIONPAY ((byte)3, "银联二维码"),
    NET ((byte)4, "网关");

    private Byte type;
    private String info;

    ProductTypeEnum(Byte type, String info) {
        this.type = type;
        this.info = info;
    }

    public Byte getType() {
        return type;
    }

    public void setType(Byte type) {
        this.type = type;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public static String getInfo(Byte type) {

        String info = "";

        for (ProductTypeEnum p : ProductTypeEnum.values()) {
            if (p.getType().equals(type)) {
                info = p.getInfo();
                break;
            }
        }

        return info;
    }

    public static ProductTypeEnum getByType(Byte type) {
        for (ProductTypeEnum p : ProductTypeEnum.values()) {
            if (p.getType().equals(type)) {
                return p;
            }
        }
        return null;
    }
}
